<template>
  <div
    class="btn"
    :class="{ primary: type == 'primary', success: type == 'success' }"
    @click="handlerclick"
  >
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: { type: { type: String } },
  data() {
    return {};
  },
  methods: {
    handlerclick(e) {
      this.$emit("click", e);
    },
  },
};
</script>

<style lang="less" scoped>
.btn {
  width: 90%;
  height: 40px;
  border-radius: 20px;
  text-align: center;
  line-height: 40px;
  font-size: 20px;
  background-color: rgb(177, 8, 22);
  color: #fff;
  margin: 10px auto;
}
.success {
  background-color: rgb(35, 194, 20);
  color: #fff;
}
.primary {
  background-color: rgb(177, 8, 22);
  color: #fff;
}
</style>
